{extend name="public/base"/}
{block name="body"}
<script src="__PUBLIC__/js/jquery.js"></script>
{include file="public/frank" /}
{/block}
{block name="script"}
<script type="text/javascript">
  var addUrl = "{:url('index/cart/add')}",
      minusUrl = "{:url('index/cart/minus')}",
      clearUrl="{:url('index/cart/clear')}",
      cartListUrl ="{:url('index/cart/getCartlist')}";
</script>


<script src="__PUBLIC__/xsd/js/cart.js?v=1111111121111" charset="utf-8"></script>
<script>
  $(function(){
    $(document).on('click', '.tgxd' , function(){
      var url = $(this).attr('data-url'),num = parseInt($('[data-dismiss="cartpopup"]').attr('attr-quantity'))
      var subscribe = '{$subscribe}';
      if(subscribe != 1){
        $.get("{:url('index/getSubscribe')}", function(data){
          if(data.value == 0){
            mui.alert('<img src="/public/images/qrcode_for_wx.jpg" style="width:100%;"><p style=" text-align: left;"><b>无法识别二维码</b><br />1、打开微信，点击‘添加朋友’<br />2、点击公众号<br />3、搜索公众号：贵阳鲜果屋<br />4、点击‘关注’，完成</p>', '请长按扫二维码关注公众号');
            return ;
          }else {
            if(num>0){
            window.location.href = "{:url('index/cart/frank')}"
            }else{
              mui.toast('请添加购买的商品！')
            }
          }
        })

      }else{
        if(num>0){
        window.location.href = "{:url('index/cart/frank')}"
        }else{
          mui.toast('请添加购买的商品！')
        }
      }
    })
  })

  $(function(){
    $('.pref-info').click(function(){
      var info=$(this).text()
      mui.alert(info, '公告', '关闭',function() {
      });
    })
  })

</script>

{include file="public/previewimage" /}

{/block}
